Generic/FunctionCallArgumentSpacing: remove assignment operator spacing checks#2399
Merged
sertand merged 1 commit intosquizlabs:masterfrom May 23, 2019
Conversation
…ng checks As discussed in 2387, there are dedicated sniffs for checking the spacing around assignment operators: * `PSR12.Operators.OperatorSpacing` * `Squiz.WhiteSpace.OperatorSpacing` Both of these are more comprehensive and more appropriate to use than the limited assignment operator spacing check in this sniff. Removing the assignment operator spacing checks from this sniff, lowers the risk of fixer conflicts regarding operator spacing and gets rid of duplicate notices in the `PSR12` and `Squiz` standard and inappropriate notices for the `PEAR`, `PSR2` and `Zend` standard. Includes adjusted unit tests.
12 tasks
Member
|
Thanks for the patch. |
Member
|
An unintended benefit of this change was that the PEAR, PSR2, and PSR12 standard are no longer checking assignment operators inside function calls. They should never have been doing this, but the Squiz standard was, and so they inherited it. |
rodrigoprimo
added a commit
to rodrigoprimo/PHP_CodeSniffer
that referenced
this pull request
Apr 2, 2025
…out spacing around equal sign The FunctionCallArgumentSpacing sniff used to check for spacing around the equal sign in the arguments of a function declaration. But this was removed in squizlabs/PHP_CodeSniffer#2399 (commit feeda47). This commit updates the sniff XML doc to reflect this change.
Merged
11 tasks
jrfnl
pushed a commit
to rodrigoprimo/PHP_CodeSniffer
that referenced
this pull request
Apr 3, 2025
…out spacing around equal sign The FunctionCallArgumentSpacing sniff used to check for spacing around the equal sign in the arguments of a function declaration. But this was removed in squizlabs/PHP_CodeSniffer#2399 (commit feeda47). This commit updates the sniff XML doc to reflect this change.
jrfnl
pushed a commit
to PHPCSStandards/PHP_CodeSniffer
that referenced
this pull request
Apr 3, 2025
…out spacing around equal sign The FunctionCallArgumentSpacing sniff used to check for spacing around the equal sign in the arguments of a function declaration. But this was removed in squizlabs/PHP_CodeSniffer#2399 (commit feeda47). This commit updates the sniff XML doc to reflect this change.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
As discussed in #2387, there are dedicated sniffs for checking the spacing around assignment operators:
PSR12.Operators.OperatorSpacingSquiz.WhiteSpace.OperatorSpacingBoth of these are more comprehensive and more appropriate to use than the limited assignment operator spacing check in this sniff.
Removing the assignment operator spacing checks from this sniff, lowers the risk of fixer conflicts regarding operator spacing and gets rid of duplicate notices in the
PSR12andSquizstandard and inappropriate notices for thePEAR,PSR2andZendstandard.Includes adjusted unit tests.